Conversation
|
The problem I see with this pr, is that if there are say two sockets in the list and the second (last one) is to be closed, we'll mark it as closable but not actually handle it. I would much prefer to see us build a list of them, then delete and remove from the socket list at the end if there are any in list, or somehow otherwise handle this. Otherwise we'll have two code paths where sockets should be closed; one in the loop and one outside the loop which would require some code duplication. |
|
or simply checking if it is the last member before flagging it for close, and if it is just close it. |
added a check for last list entry needing closed, and handling that.
|
I made the changes, to handle your concerns. |
|




server was crashing on client disconnect because the object pointed to by the iterator was being deleted before advancing the iterator. by waiting to close the socket till the next pass through the loop we can safely delete the dead socket.